<!--Copyright https://gitee.com/laiyw/monitor-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Server Monitor JVM</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf8"/>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="bootstrap/css/bootstrap-table.min.css"/>
</head>
<body>
<div class="container">
    <table id="jvmInfoTable" class="table table-hover">
        <tr>
            <td width="15%">名称</td>
            <td width="30%"></td>
            <td width="15%">供应商</td>
            <td></td>
        </tr>
        <tr>
            <td>运行环境版本</td>
            <td></td>
            <td>实现版本</td>
            <td></td>
        </tr>
        <tr>
            <td>安装目录</td>
            <td colspan="3"></td>
        </tr>
        <tr>
            <td>默认的临时文件路径</td>
            <td colspan="3"></td>
        </tr>
        <tr>
            <td>扩展目录路径</td>
            <td colspan="3"></td>
        </tr>
        <tr>
            <td>Java类路径</td>
            <td colspan="3"></td>
        </tr>
        <tr>
            <td>启动时间</td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>启动参数</td>
            <td colspan="3"></td>
        </tr>
    </table>
</div>
<script src="js/jquery.min.js" type="text/javascript" charset="utf8"></script>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript" charset="utf8"></script>
<script src="bootstrap/js/bootstrap-table.min.js" type="text/javascript" charset="utf8"></script>
<script src="bootstrap/js/bootstrap-table-zh-CN.min.js" type="text/javascript" charset="utf8"></script>
<script src="js/common.js" type="text/javascript" charset="utf8"></script>
<script type="text/javascript">
    $.namespace("monitor.jvm");
    monitor.jvm = function () {
        return {
            init: function () {
                monitor.common.buildHeadAndInitInterval(2, this.ajax);
            },
            ajax: function () {
                $.ajax({
                    type: 'POST',
                    url: 'jvm.json',
                    dataType: "json",
                    success: function (data) {
                        monitor.jvm.jvmInfo(data);
                    }
                });
            },
            jvmInfo: function (data) {
                var table = $("#jvmInfoTable");
                table.find("tr:eq(0)").find("td:eq(1)").text(data.name);
                table.find("tr:eq(0)").find("td:eq(3)").text(data.vmVendor);

                table.find("tr:eq(1)").find("td:eq(1)").text(data.runVersion);
                table.find("tr:eq(1)").find("td:eq(3)").text(data.vmVersion);

                table.find("tr:eq(2)").find("td:eq(1)").text(data.installDir);

                table.find("tr:eq(3)").find("td:eq(1)").text(data.tmpDir);

                table.find("tr:eq(4)").find("td:eq(1)").text(data.extDirs);

                table.find("tr:eq(5)").find("td:eq(1)").text(data.classPath);

                table.find("tr:eq(6)").find("td:eq(1)").text(data.startTime);
                table.find("tr:eq(6)").find("td:eq(3)").text(data.runtime);

                table.find("tr:eq(7)").find("td:eq(1)").html(data.inputArguments.toString().replace(new RegExp(',', 'g'), '<p>'));
            }
        }
    }();

    $(document).ready(function () {
        monitor.jvm.init();
    });
</script>
</body>
</html>